#pragma once
#include "afxwin.h"

// CDialogAddDevice dialog
class CCameraInfo;
class CDialogAddDevice : public CDialogEx
{
	DECLARE_DYNAMIC(CDialogAddDevice)

public:
	CDialogAddDevice(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDialogAddDevice();

	enum {
		ADD_WEB_CAM		= 0,				// add Web camera 
		ADD_IP_CAM,							// add ip camera
		ADD_VIDEO_SRC						// add video source
	};
// Dialog Data
	enum { IDD = IDD_DIALOG_ADD_DEVICE };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
private:
	CComboBox m_cmbDeviceCategory;
	CEdit m_edtCamName;
	CEdit m_edtCamAddress;
	CEdit m_edtCamPort;
	CComboBox m_cmbCamCodecs;
	CEdit m_edtCamUsername;
	BOOL m_chkCamAuth;
	CEdit m_edtCamPwd;
	CEdit m_edtCamURL;

	int	m_nAddDeviceType;

	void ShowControlsByType(int nType = 0);
	void ShowControlsForIPCam(BOOL bShow = FALSE);
	void ShowControlsForWebCam(BOOL bShow = FALSE);
	void ShowControlsForVideoSrc(BOOL bShow = FALSE);

	void ValidateForIpCam();
	void ValidateForWebCam();
	void ValidateForVideoSrc();
public:
	CCameraInfo* pCameraInfo;
public:
	afx_msg void OnBnClickedBtnAddDevice();
	afx_msg void OnBnClickedCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnCbnSelchangeCmbDeviceCate();
};
